package com.wwy.geteway.config;

/**
 * @author 王伟羽
 * @program: almighty
 * @description:
 * @create: 2025/01/02
 */

import cn.dev33.satoken.stp.StpInterface;
import com.wwy.geteway.config.redis.RedisService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * 自定义权限验证接口扩展
 */
@Component
public class StpInterfaceImpl implements StpInterface {

    private static final String PREFIX = "user_info:data";

    @Resource
    private RedisService redisService;

    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        String str = redisService.getStr(PREFIX, loginId.toString());
        // 返回此 loginId 拥有的权限列表
        return null;
    }

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        // 返回此 loginId 拥有的角色列表
        return null;
    }

}
